#!/usr/bin/python3
# -*- coding: utf-8 -*-

import yaml
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
config_path = os.path.join(BASE_DIR, 'config/data.yaml')

config = {}

def get_config(path):
    if not os.path.exists(path): return
    with open(path) as f:
        conf = yaml.safe_load(f)
        set_config(conf)

def set_config(conf):
    global config
    config = dict(config, **conf)

get_config(config_path)
get_config('src/web/config/data.yaml')
